package queries;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import entitys.ProductInType;

/**
 * returns the list of all associations in ccrm.productintype
 * @author Dima
 *
 */
public class GetTrioListQuery {
		public static ArrayList<ProductInType> exe(Connection conn) {
			ArrayList<ProductInType> arr = new ArrayList<ProductInType>();
			ResultSet res = null; 
			Statement stmt;

				try {
					stmt = conn.createStatement();
					res = stmt.executeQuery("SELECT * from ccrm.productintype; ");
					
					while(res.next())
					{
						arr.add(new ProductInType(res.getInt(1), res.getInt(2), res.getInt(3)));
					}
				} catch (SQLException e) {
					// TODO Auto-generated catch block
					System.out.println("Error in retrieving trios");
				}
				try {
					res.close();
				} catch (SQLException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				
			return arr;
			
		}


	

}
